<template>
  <div ref="innerLinkRef" style="height: 100%;">
    <a-spin style="width: 100%; height: calc(100% - 6px);" :loading="loading" tip="数据加载中">
      <iframe scrolling="no" @load="handleIframeLoad" :id="iframeId" :src="src" width="100%" height="100%"
        frameborder="0"></iframe>
    </a-spin>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
// 定义属性
const props = defineProps<{
  src: string
  iframeId: string
}>();

const loading = ref(true)

const innerLinkRef = ref<HTMLIFrameElement>()
// const height = ref(0)
const handleIframeLoad = () => {
  loading.value = false
}
onMounted(() => {
  // height.value = innerLinkRef.value!.parentElement!.clientHeight - 6
})

</script>

<style lang="less" scoped></style>